<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>canvas</title>
  <style>
    #canvas{
      background-color: rgb(92, 89, 89);
    }
  </style>
</head>
<body>
  <canvas id="canvas" width="800px" height="400px"></canvas>
  <script>
    const canvas=document.getElementById("canvas")
    const ctx=canvas.getContext('2d')
    ctx.beginPath();
    ctx.strokeStyle="yellowgreen";
    ctx.moveTo(100,100);
    ctx.lineTo(200,200);
    ctx.lineTo(300,100);
    ctx.lineTo(100,100);
    ctx.stroke();
    
  
  </script>
</body>

</html>